package com.zhongyu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongyu.mapper.RukuMapper;
import com.zhongyu.pojo.Order;
import com.zhongyu.pojo.OrderDetail;
import com.zhongyu.service.RukuService;
import com.zhongyu.vo.PageResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("rukuService")
public class RukuServiceImpl extends ServiceImpl<RukuMapper, Order> implements RukuService {

    @Resource
    private RukuMapper rukuMapper;

    @Override
    public PageResult searchAll(Integer pageNo, Integer pageSize) {
        LambdaQueryWrapper<Order> wrapper= Wrappers.<Order>lambdaQuery();
        Page page=new Page(pageNo,pageSize);
        List<Order> list=rukuMapper.findAll(page,wrapper);
        return new PageResult(list,page.getTotal());
    }

    @Override
    public List<Order> searchAll(Integer id) {
        return rukuMapper.searchAll(id);
    }

    @Override
    public List<Order> search(Integer id) {
        return rukuMapper.search(id);
    }


}
